from building import *
import pyglet
from unit import *


class Faction:

	def __init__(self):
		pyglet.resource.add_font('%s.ttf' % self.font_name)


class Insectile(Faction):

	id = 1
	name = 'Insectile'
	font_name = 'Luteous Exodus'
	font_size = 20
	buildings = [Hive]
	units = [RollyPoly]


class ArmoredClunky(Faction):

	id = 2
	name = 'Clunky'
	font_name = 'Bitsumishi'
	font_size = 16
	buildings = [Citadel]
	units = [Bot]


class Sleek(Faction):

	id = 3
	name = 'Sleek'
	font_name = 'FontLogic Normal'
	font_size = 12
	buildings = [Sanctuary]
	units = [Rifleman, Hoverjet]


factions = set()
factions.add(Insectile())
factions.add(ArmoredClunky())
factions.add(Sleek())


def get(id_or_name):
	for f in factions:
		if id_or_name in (f.id, f.name.lower()):
			return f
	return None

